<table>
    <thead>
        <tr>
            <g:sortableColumn property="id" title="${message(code: 'b2b.salesOrder.id', default: 'Id')}" params="[status : params?.status]"/>
            <g:sortableColumn property="recordType" title="${message(code: 'b2b.salesOrder.recordType', default: 'Record Type')}" params="[status : params?.status]"/>
            <g:sortableColumn property="accountSerialNumber" title="${message(code: 'b2b.salesOrder.accountSerialNumber', default: 'Account Order Number')}" params="[status : params?.status]"/>
            <g:sortableColumn property="serialNumber" title="${message(code: 'b2b.salesOrder.serialNumber', default: 'Order Number')}" params="[status : params?.status]"/>
            <g:sortableColumn property="orderDate" title="${message(code: 'b2b.salesOrder.orderDate', default: 'Order Date')}" params="[status : params?.status]"/>
            <g:sortableColumn property="effectiveDate" title="${message(code: 'b2b.salesOrder.effectiveDate', default: 'Effective Date')}" params="[status : params?.status]"/>
            <g:sortableColumn property="dealer" title="${message(code: 'b2b.salesOrder.dealer', default: 'Dealer')}" params="[status : params?.status]"/>
            <th><g:message code="b2b.salesOrder.department" default="Department" /></th>
            <g:sortableColumn property="salesMan" title="${message(code: 'b2b.salesOrder.salesMan', default: 'Sales Man')}" params="[status : params?.status]"/>
            <g:sortableColumn property="project" title="${message(code: 'b2b.salesOrder.project', default: 'Project')}" params="[status : params?.status]"/>
            <g:sortableColumn property="industry" title="${message(code: 'b2b.salesOrder.industry', default: 'Industry')}" params="[status : params?.status]"/>
            <th><g:message code="b2b.salesOrder.status" default="Status" /></th>
            
        </tr>
    </thead>
    <tbody>
    <g:each in="${salesOrderInstanceList}" status="i" var="salesOrderInstance">
        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
            <td><g:link action="show" id="${salesOrderInstance.id}">${fieldValue(bean: salesOrderInstance, field: "id")}</g:link></td>
            <td><g:link action="show" id="${salesOrderInstance.id}">${fieldValue(bean: salesOrderInstance, field: "recordType")}</g:link></td>
            <td><g:link action="show" id="${salesOrderInstance.id}">${fieldValue(bean: salesOrderInstance, field: "accountSerialNumber")}</g:link></td>
            <td><g:link action="show" id="${salesOrderInstance.id}">${fieldValue(bean: salesOrderInstance, field: "serialNumber")}</g:link></td>
            <td><g:link action="show" id="${salesOrderInstance.id}"><g:formatDate format="yyyy-MM-dd" date="${salesOrderInstance.orderDate}" /></g:link></td>
            <td><g:link action="show" id="${salesOrderInstance.id}"><g:formatDate format="yyyy-MM-dd" date="${salesOrderInstance.effectiveDate}" /></g:link></td>
            <td><g:link action="show" id="${salesOrderInstance.id}">${salesOrderInstance?.dealer?.encodeAsHTML()}</g:link></td>
            <td><g:link action="show" id="${salesOrderInstance.id}">${salesOrderInstance?.dealer?.department?.encodeAsHTML()}</g:link></td>
            <td><g:link action="show" id="${salesOrderInstance.id}">${salesOrderInstance?.salesMan?.encodeAsHTML()}</g:link></td>
            <td><g:link action="show" id="${salesOrderInstance.id}">${fieldValue(bean: salesOrderInstance, field: "project")}</g:link></td>
            <td><g:link action="show" id="${salesOrderInstance.id}">${fieldValue(bean: salesOrderInstance, field: "industry")}</g:link></td>
            <td><g:link action="show" id="${salesOrderInstance.id}">${fieldValue(bean: salesOrderInstance, field: "status")}</g:link></td>
        </tr>
    </g:each>
    </tbody>
</table>
